/** @jsxImportSource @emotion/react */
import * as React from "react";
import {CCell, Cell, Table, TableBody, TableRow, Text,} from "customize-easy-ui-component";
import { DirectLink } from "../../../routing/Link";
import {检验设备结论} from "../../boiler/viewRes";
import {useThreeColumnView} from "../../hook/useThreeColumnSubr";
import {config设备概况} from "./orcBase";


//整个结论报告页
export const 检验结论报告= ({ orc, rep,theme } : { orc: any, rep: any,theme:any}
) => {
  //拆分：各列宽度可以当地调节了
  const [firstNode,secNode]=useThreeColumnView({orc, config:config设备概况,slash:true,split:[10],});
  return <>
    <Text variant="h2" css={{
      textAlign: 'center',
      "@media print": {
        pageBreakBefore: 'always',
      },
    }}>有机热载体锅炉及系统内部检验报告</Text>
    <div id={'Survey'} css={{
      display: 'flex',
      justifyContent: 'space-between',
      flexDirection: 'column',
      [theme.mediaQueries.md]: {
        flexDirection: 'row',
      }
    }}>
      <Text>单位内部编号：{orc?.单位内部编号}</Text>
      <Text>报告编号：{rep.isp?.no}</Text>
    </div>
    <Table fixed={ ["14.5%","32%","19%","12.1%","7%","%"]  } css={ {borderCollapse: 'collapse' } }  tight  miniw={800}>
      <TableBody>
        <DirectLink  href={`/report/${rep?.modeltype}/ver/${rep?.modelversion}/${rep?.id}/Survey#Survey`}>
          {firstNode}
        </DirectLink>
      </TableBody>
    </Table>
    <Table fixed={ ["14.5%","26%","8.2%","23%","8.2%","%"] } css={ {borderCollapse: 'collapse' } }  tight  miniw={800}>
      <TableBody>
        <DirectLink  href={`/report/${rep?.modeltype}/ver/${rep?.modelversion}/${rep?.id}/Survey#Survey`}>
          {secNode}
        </DirectLink>
      </TableBody>
    </Table>
    <Table fixed={ ["14.5%", "%"] } css={{borderCollapse: 'collapse'}} tight miniw={800}>
      <TableBody>
        <DirectLink href={`/report/${rep?.modeltype}/ver/${rep?.modelversion}/${rep?.id}/Conclusion#Conclusion`}>
          <TableRow>
            <CCell >资料审查</CCell>
            <Cell  css={{whiteSpace:'pre-line' }}>
              {orc.资料审查}
            </Cell>
          </TableRow>
          <TableRow>
            <CCell >上次检验提出问题及处理意见</CCell>
            <Cell ><div css={{minHeight: '2rem',whiteSpace:'pre-wrap'}}>
              {orc.上检问题}</div></Cell>
          </TableRow>
          <TableRow>
            <CCell >缺陷及其处理</CCell>
            <Cell ><div css={{minHeight: '2rem',whiteSpace:'pre-wrap'}}>
             {orc.问题及处}</div></Cell>
          </TableRow>
        </DirectLink>
      </TableBody>
    </Table>

    {检验设备结论({theme, orc, rep})}
  </>;
};

//,whiteSpace:'pre-wrap' whiteSpace:'pre-line'可直接替代
